"""
内容：将根据订单号查询订单设计成一个类 输入会员名字进行查询
作者：赵柚桥
"""
# 引入模块

from ECshop.common.base import Base

# 创建一个查询订单类
class OrderManagement(Base):
    # 定义属性
    url = 'http://localhost:8080/ecshop/admin/'
    frame_name_01 = 'menu-frame'
    frame_name_02 = 'main-frame'
    order_management = ('class name', 'icon-order')
    order_inquiry = ('css selector', 'a[href="order.php?act=order_query"]')
    order_id_01 = ('name', 'order_sn')
    query_button = ('name', 'query')
    order_id_02 = ('id', 'order_0')
    # 定义方法
    # 定义方法
    """获取网页"""

    def page_login_open_web(self):
        self.base_open_web(self.url)

    # 进入frame
    def page_in_frame_01(self):
        self.base_in_frame(self.frame_name_01)
    "点击订单管理"

    def page_click_order_management(self):
        self.base_click(self.order_management)
    """点击订单查询"""
    def page_click_order_inquiry(self):
        self.base_click(self.order_inquiry)
    # 退出frame
    def page_out_frame(self):
        self.base_quit_frame()

    # 再次进入frame
    def page_in_frame_02(self):
        self.base_in_frame(self.frame_name_02)
    """输入订单号"""
    def page_input_order_id(self, your_order_id):
        self.base_input_content(self.order_id_01, your_order_id)
    """点击搜索按钮"""
    def page_click_query_button(self):
        self.base_click(self.query_button)
    """获取查询到的订单号"""
    def page_get_order_id(self):
        return self.base_get_text(self.order_id_02)
    """退出"""
    def page_quit(self):
        self.base_quit()